Skip to content

Conversation

@aspeddro
Copy link
Collaborator

try for i in 0 to 200 {
  Js.log(i)
} catch {
| Not_found => ()
}

Playground

(source_file [0, 0] - [5, 0]
  (expression_statement [0, 0] - [4, 1]
    (try_expression [0, 0] - [4, 1]
      (ERROR [0, 4] - [0, 21]
        (value_identifier [0, 4] - [0, 7])
        (ERROR [0, 8] - [0, 9])
        (number [0, 13] - [0, 14])
        (number [0, 18] - [0, 21]))
      (block [0, 22] - [2, 1]
        (expression_statement [1, 2] - [1, 11]
          (call_expression [1, 2] - [1, 11]
            function: (value_identifier_path [1, 2] - [1, 8]
              (module_identifier [1, 2] - [1, 4])
              (value_identifier [1, 5] - [1, 8]))
            arguments: (arguments [1, 8] - [1, 11]
              (value_identifier [1, 9] - [1, 10])))))
      (switch_match [3, 0] - [3, 17]
        pattern: (variant_pattern [3, 2] - [3, 11]
          (variant_identifier [3, 2] - [3, 11]))
        body: (sequence_expression [3, 15] - [3, 17]
          (expression_statement [3, 15] - [3, 17]
            (unit [3, 15] - [3, 17])))))))

@nkrkv
Copy link
Collaborator

nkrkv commented Apr 21, 2023

Thank you!

@nkrkv nkrkv merged commit 3fcb35a into rescript-lang:main Apr 21, 2023
@aspeddro aspeddro deleted the fix-try-expression branch April 21, 2023 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants